home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / dlbox_2 / dlfuncs.doc < prev    next >
Encoding:
Text File  |  1995-02-27  |  12.2 KB  |  515 lines

  1.                           DLBOX 2.0
  2.        COPYRIGHT 1995 William Hatcher All Rights Reserved
  3.  
  4. Available functions in library.
  5.  
  6. The following functions are public for the interface_class object.
  7.  
  8. ADDBAR
  9.  
  10.        Prototype
  11.  
  12.        void addbar(char *string,int background_color);
  13.        
  14.        Function
  15.  
  16.        Specifies for a title bar to be drawn on the dialog box.  The size
  17.        is 20 pixels high and is drawn from 0,0 down on the dialog box.
  18.        The first parameter is the text to be drawn on the bar.
  19.  
  20. ADDBOX
  21.  
  22.        Prototype
  23.  
  24.        void addbox(int x, int y, int width, int height);
  25.  
  26.        Function
  27.  
  28.        Specifies the dimensions and parameters of the new dialog box.
  29.        Must be given before any of the item commands.  The first two
  30.        parameters specify the position of the box in real-screen
  31.        coordinates.  The next two values specify the width and height
  32.        of the box.
  33.        
  34. ADDBUTTON
  35.  
  36.        Prototype
  37.  
  38.        void addbutton(char *string,int x, int y, int item_id,int width);
  39.  
  40.        Function
  41.  
  42.        This function adds a button to the interface.  The first parameter
  43.        is a string that is the text to be printed on the button.  X and y
  44.        specify the coordinates of the top left of the button.  Item_id is
  45.        the item ID number.  Width specifies how wide the button is to 
  46.        be (in pixels).
  47.  
  48. ADDCHECKBOX
  49.  
  50.        Prototype
  51.  
  52.        void addcheckbox(char *string, int x, int y, int item_id, 
  53.        CHECKBOX_STATUS c);
  54.  
  55.        Function
  56.  
  57.        Adds a checkbox to the dialog box.  The first parameter specifies
  58.        the string to be printed beside the box.  X and y specify the 
  59.        relative coordinates of the checkbox.  Item_id is the item ID 
  60.        number.  The last parameter is the default status of the 
  61.        checkbox.  CHECKED specifies the box should be checked when
  62.        the dialog box starts.  UNCHECKED specifies the opposite.
  63.  
  64. ADDFIELD        
  65.  
  66.        Prototype
  67.  
  68.        void addfield(char *string, int x, int y, int width, int item_id,
  69.        FIELDTYPE f);
  70.  
  71.        Function
  72.  
  73.        This function adds a field to the interface.  The first parameter
  74.        specifies a string (optionally zero length) that will be printed
  75.        as default in the field.  X and y specify the coordinates of the
  76.        top left of the field.  Item_id is the item ID number.  Width
  77.        specifies the size of the field in characters.  The last parameter
  78.        specifies if it is to be a NUMBER or a TEXT field.  Number fields
  79.        return integer numbers and TEXT fields return text strings (up to
  80.        MAXSTRINGLEN).  It is recommended to use the TEXT field type
  81.        since it may also be used for numbers including floats.  All that
  82.        is necessary is to use one of c's string to number functions.
  83.  
  84. ADDLINE
  85.  
  86.        Prototype
  87.  
  88.        void addline(int x1,int y1,int x2,int y2,int color);
  89.  
  90.        Function
  91.  
  92.        Specifies a line to be drawn on the dialog box with the specified
  93.        color.
  94.  
  95. ADDLBOX
  96.  
  97.        Prototype
  98.  
  99.        void addlbox(int x1,int y1,int x2,int y2,int color);
  100.  
  101.        Function
  102.  
  103.        Specifies that a box (made of lines) be drawn on the dialog box
  104.        with the specified color.
  105.  
  106. ADDPIC_B
  107.  
  108.        Prototype
  109.  
  110.        void addpic_b(int x, int y, int width, int height, int item_id
  111.        void far *p);
  112.  
  113.        Function
  114.  
  115.        Adds a picture button to the dialog box.  These function like  
  116.        buttons but appear as a bitmapped pictures.  The bitmap
  117.        should be saved using Turbo's getimage function (in 16 color
  118.        mode as well).  The first two parameters specify the x and y
  119.        coordinates of the top left of the picture.  The next two
  120.        specify the width and height of the picture.  The next parameter
  121.        is the item ID number.  The final parameter is the pointer
  122.        to the image that was used in the getimage function.
  123.  
  124. ADDPIC_S
  125.  
  126.        Prototype
  127.  
  128.        void addpic_s(int x, int y, void far *p);
  129.  
  130.        Function
  131.  
  132.        This is similar to the addpic_b function.  However, this merely
  133.        places a static picture pointed to by p at the coordinates x
  134.        and y.
  135.  
  136. ADDRADIO
  137.  
  138.        Prototype
  139.  
  140.        void addradio(char *string,int x, int y, int item_id, int radio_id,
  141.        CHECKBOX_STATUS c);
  142.  
  143.        Function
  144.  
  145.        Adds a radio button to the dialog box.  The first parameter specifies
  146.        the string to be printed beside the button.  X and y specify the 
  147.        relative coordinates of the button.  Item_id is the item ID 
  148.        number.  Radio_id is the group id this radio button belongs to.
  149.        The last parameter is the default status of the 
  150.        button.  CHECKED specifies the button should be checked when
  151.        the dialog box starts.  UNCHECKED specifies the opposite.
  152.  
  153. ADDTITLE
  154.  
  155.        Prototype
  156.  
  157.        void addtitle(char *string, int x, int y, int color, int size,
  158.        int font);
  159.  
  160.        Function
  161.  
  162.        Adds a title to the interface box with the text specified by
  163.        the string pointer.  X and y are the upper left coordinates of
  164.        the text.  The last three parameters specify the color, size,
  165.        and font to be used.
  166.  
  167. CLEAR
  168.  
  169.        Prototype
  170.  
  171.        void clear();
  172.  
  173.        Function
  174.  
  175.        Clears out the dialog box information to prepare for a new one.
  176.        Should be called before specifying anything for a new box.
  177.  
  178. DODIALOG
  179.  
  180.        Prototype
  181.  
  182.        void dodialog();
  183.        
  184.        Function
  185.  
  186.        This function instructs the interface to do the dialog box.  Calls
  187.        to obtain data from the box must occur after this statement and 
  188.        before the next clear() statement.
  189.  
  190. GET_BUTTON_INFO
  191.  
  192.        Prototype
  193.  
  194.        int get_button_info(int item_id);
  195.  
  196.        Function
  197.  
  198.        This function returns the status of the button with the
  199.        corresponding item id.  1 means the button was pressed and
  200.        0 means it was not.  Note that only one button can return
  201.        a 1 result.
  202.  
  203. GET_CHECKBOX_INFO
  204.  
  205.        Prototype
  206.  
  207.        int get_checkbox_info(int item_id);
  208.  
  209.        Function
  210.  
  211.        This function returns the status of the checkbox with the
  212.        corresponding item id.  1 means the checkbox was checked
  213.        and a 0 means it was not.
  214.  
  215. GET_NUMBER_FIELD_INFO
  216.  
  217.        Prototype
  218.  
  219.        int get_number_field_info(int item_id);
  220.  
  221.        Function
  222.  
  223.        This function returns the integer entered into the given number 
  224.        field.
  225.  
  226. GET_PIC_INFO
  227.  
  228.        Prototype
  229.  
  230.        int get_pic_info(int item_id);
  231.  
  232.        Function
  233.        
  234.        This function returns the status of the picture button with the
  235.        corresponding item id.  1 means the button was pressed and
  236.        0 means it was not.  Note that only one button can return
  237.        a 1 result.
  238.  
  239. GET_RADIO_INFO
  240.  
  241.        Prototype
  242.  
  243.        int get_radio_info(int item_id);
  244.  
  245.        Function
  246.  
  247.        This function returns the status of the radio button with 
  248.        the corresponding item id.  1 means the radio button was
  249.        active and 0 means it was not.
  250.  
  251. GET_TEXT_FIELD_INFO
  252.        
  253.        Prototype
  254.  
  255.        char * get_text_field_info(int item_id);
  256.  
  257.        Function
  258.  
  259.        This function returns a pointer to the string entered into the 
  260.        corresponding text field.  This should be copied into a new
  261.        string since it will be erased when the clear() command is issued.
  262.  
  263. LOCK_MOUSE_IN_BOX
  264.  
  265.        Prototype
  266.  
  267.        void lock_mouse_in_box();
  268.  
  269.        Function
  270.  
  271.        Specifies to lock the mouse inside the dialog box.  The mouse will
  272.        be restricted to the perimeter of the dialog box.
  273.  
  274. PLACE_MOUSE
  275.  
  276.        Prototype
  277.  
  278.        void place_mouse(int x_coordinate, int y_coordinate);
  279.  
  280.        Function
  281.  
  282.        Instructs the dialog box to place the mouse at the given coordinates
  283.        when the dialog box is displayed.
  284.  
  285. SET_DONT_ERASE        
  286.        
  287.        Prototype
  288.  
  289.        void set_dont_erase();
  290.  
  291.        Function
  292.  
  293.        Specifies that the dialog box should not be erased after it is
  294.        exited.  This might help in low memory situations since the area
  295.        behind the box is saved.  Must be used for dialog boxes whose
  296.        size would exceed 64Kb imagesize.
  297.  
  298. SET_MOUSE_BOUNDS
  299.  
  300.        Prototype
  301.  
  302.        void (int x1,int y1,int x2,int y2);
  303.  
  304.        Function
  305.  
  306.        Specifies for the dialog box to lock the mouse within the rectangle
  307.        given by the coordinates.
  308.  
  309. **************
  310.  
  311. Mouse functions available through interface.  
  312.  
  313. Example call:  iface.mouse.show();
  314.  
  315. BUTTONRELEASE
  316.  
  317.        Prototype
  318.  
  319.        void buttonrelease(unsigned int *button, unsigned int * buttonstatus,
  320.        unsigned int *releases, unsigned int * x, unsigned int *y);
  321.  
  322.        Function
  323.  
  324.        Gets information about button releases.  Returns data through
  325.        calling parameter pointers.  The first parameter controls which
  326.        button will be checked.  If the button pointer points to a 0, 
  327.        the left button is checked.  If it is 1 the right button is 
  328.        checked.  *releases is the number of times the button has been
  329.        released since last call.  *x and *y are the coordinates at the 
  330.        last time the specified button was released.
  331.  
  332. BUTTONS
  333.        
  334.        Prototype
  335.  
  336.        void buttons(unsigned int *button, unsigned int * buttonstatus,
  337.        unsigned int *presses, unsigned int * x, unsigned int *y);
  338.  
  339.        Function
  340.  
  341.        Gets information about button presses.  Returns data through
  342.        calling parameter pointers.  The first parameter controls which
  343.        button will be checked.  If the button pointer points to a 0, 
  344.        the left button is checked.  If it is 1 the right button is 
  345.        checked.  *presses is the number of times the button has been
  346.        pressed since last call.  *x and *y are the coordinates at the 
  347.        last time the specified button was pressed.
  348.  
  349. HIDE
  350.  
  351.        Prototype
  352.  
  353.        void hide();
  354.  
  355.        Function
  356.  
  357.        Hides the mouse pointer.
  358.  
  359. INBOX        
  360.        
  361.        Prototype
  362.  
  363.        int inbox(unsigned int x1, unsigned int y1,
  364.        unsigned int x2, unsigned int y2);
  365.  
  366.        Function
  367.  
  368.        Returns 1 if the mouse is inside the box specified by the coordinates
  369.        given.  Returns 0 otherwise.
  370.  
  371. LEFTBUTTONDOWN
  372.  
  373.        Prototype
  374.  
  375.        int leftbuttondown();
  376.  
  377.        Function
  378.  
  379.        Returns 1 if the left button is current depressed or 0 if not.
  380.       
  381. LEFTBUTTONPRESSED
  382.  
  383.        Prototype
  384.  
  385.        int leftbuttonpressed();
  386.        
  387.        Function
  388.  
  389.        Returns 1 is the left button has been pressed since last call
  390.        or zero of not.  Also sets up leftx and lefty values.  These
  391.        may be accessed since they are public values.
  392.  
  393. MOUSEDRIVER
  394.  
  395.        Prototype
  396.  
  397.        void mousedriver(unsigned int*m1,unsigned int*m2,unsigned int*m3,
  398.        unsigned int*m4,unsigned int*m5);
  399.        
  400.        Function
  401.  
  402.        For direct calls to the mouse driver for functions not included 
  403.        with the library package.
  404.  
  405. MRESET
  406.  
  407.        Prototype
  408.  
  409.        int mreset();
  410.  
  411.        Function
  412.  
  413.        Performs a software reset of the mouse function.  Returns 1 on
  414.        valid reset and 0 for an invalid reset.
  415.  
  416. PLACE
  417.  
  418.        Prototype
  419.  
  420.        void place(unsigned int x, unsigned int y);
  421.  
  422.        Function
  423.  
  424.        Places the mouse pointer at the given coordinates.
  425.  
  426. POSX
  427.  
  428.        Prototype
  429.  
  430.        unsigned int posx();
  431.  
  432.        Function
  433.  
  434.        Returns the current x position of the mouse pointer.
  435.  
  436. POSY
  437.  
  438.        Prototype
  439.  
  440.        unsigned int posy();
  441.  
  442.        Function
  443.  
  444.        Returns the current y position of the mouse pointer.
  445.  
  446. READY
  447.  
  448.        Prototype
  449.  
  450.        int read();
  451.  
  452.        Function
  453.  
  454.        Resets the mouse.  Returns 1 if mouse is reset an ok.  Returns
  455.        0 if mouse was not reset or is not installed.
  456.  
  457. RIGHTBUTTONDOWN
  458.  
  459.        Prototype
  460.  
  461.        int rightbuttondown();
  462.  
  463.        Function
  464.  
  465.        Returns 1 if the right button is current depressed or 0 if not.
  466.        
  467. SETBOUNDS        
  468.  
  469.        Prototype
  470.  
  471.        void setbounds(unsigned int xmin,unsigned int xmax,
  472.                    unsigned int ymin,unsigned int ymax);
  473.  
  474.        Function
  475.  
  476.        Sets the screen boundaries the mouse will be forced to remain
  477.        within.  Note the order of the parameters is x,x,y,y.
  478.  
  479. SPEED
  480.  
  481.        Prototype
  482.  
  483.        void speed(unsigned int xspeed, unsigned int yspeed);
  484.  
  485.        Function
  486.  
  487.        Sets the mickey/pixel ratio of the mouse.
  488.  
  489. SHOW
  490.  
  491.        Prototype
  492.  
  493.        void show();
  494.  
  495.        Function
  496.  
  497.        Displays the mouse pointer.
  498.  
  499. STATUS
  500.  
  501.        Prototype
  502.  
  503.        void status(int *leftbutton,int *rightbutton,
  504.        unsigned int *x,unsigned int *y);
  505.  
  506.        Function
  507.  
  508.        Obtains data about the mouse buttons and mouse position.  This 
  509.        data is returned via the parameter pointers.  The variable pointed
  510.        to by leftbutton will contain 1 if the left mouse button is down
  511.        at the time of the call.  Similar situation for the rightbutton.
  512.        The variables pointed to by x and y will contain the x and y
  513.        positions of the mouse at the time of the call.
  514.  
  515.